<template>
  <div>
    <el-row type="flex" justify="center">
      <el-col :span="6">
        <el-form label-width="80px">
          <el-form-item label="用户名">
            <el-input v-model="username" placeholder="请输入用户名"></el-input>
          </el-form-item>
          <el-form-item label="密码">
            <el-input type="password" v-model="password" placeholder="请输入密码"></el-input>
          </el-form-item>
          <el-form-item>
            <el-col :span="12">
              <el-checkbox label="记住用户名"></el-checkbox>
            </el-col>
          </el-form-item>
          <el-form-item>
            <el-col :span="12">
              <el-button type="primary" @click="login">登录</el-button>
            </el-col>
            <el-col :span="12">
              <el-button type>注册</el-button>
            </el-col>
          </el-form-item>
        </el-form>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  data() {
    return {
      password: "",
      username: ""
    };
  },
  methods: {
    login() {
      const data = {
        username: this.username,
        password: this.password
      }

      this.axios.post("/login", data).then(resp => {
        console.log(resp.data);
      }).catch(error=>{
          console.log(error=>{
              console.log(error)
          })
      })
      
    }
  }
}
</script>

<style>
</style>